package com.huangliusong.demohls;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;

@SpringBootApplication
@ServletComponentScan("com.huangliusong.demohls")
public class DemohlsApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemohlsApplication.class, args);
        test();
    }

    public static void test(){
        ExpressionParser parser = new SpelExpressionParser();
        Expression exp = parser.parseExpression("new String('hello world').toUpperCase()");
        String message = exp.getValue(String.class);
        System.err.println(message);



        ExpressionParser parser1=new SpelExpressionParser();
        Expression expression=parser1.parseExpression("'huangliusong'.length()");
        Integer me=expression.getValue(Integer.class);


        System.err.println(me);
    }
}
